<?php
if (ClassImage::getCoursesPrimaryImage($data->id) <> "") {
    $imageName = '<img src="' . baseUrl() . '../../' . SkillConfig::getClassCourseImagePath($data->users_id) . '240X180/' . ClassImage::getCoursesPrimaryImage($data->id) . '"  alt="' . $data->course_titile . '">';
}else{
    $imageName='<img src="' . baseUrl() . '../../' . getUploadDir() . '/no-class-image-240X180.jpg"   alt="' . $data->course_titile . '" id="' . $data->id . '">';
}
?>
<div class="common whiteBg">
    <fieldset>
        <div class="classListing borB">
            <div class="left">
                <a href="<?php echo $this->createAbsoluteUrl('/courses-'.$data->id.'/'.$data->course_seo_title) ?>"><?php echo $imageName; ?></a>
                <input type="hidden" id="get_checked_value_<?php echo $data->id; ?>">
            </div>
            <div class="right">
                <h4 class="txttTransformNorml txt676 remmarginT"><a href="<?php echo $this->createAbsoluteUrl('/courses-'.$data->id.'/'.$data->course_seo_title) ?>"><?php echo $data->course_titile; ?></a></h4>
                <?php
                $makeQuery = MakeQuery::getConvertedCourseQuery($data->id);
                if (!empty($makeQuery)) {
                    $i = 1;
                    ?>
                    <h5 class="txttTransformNorml txt999 remmargin floatR"><p style="float: left;margin: 6px!important;">Select All</p><p style="float: left;"><input type="checkbox" id="select_All_<?php echo $data->id; ?>" class="selectAllcheckbox" ></p></h5>
                    <p class="fnt-size14 font-opensansbd">Attendees (List of converts /confirmations)</p>
                    <div class="clear"></div>
                    <div class="attendeesList">
                        <?php
                        foreach ($makeQuery as $makeQueryvalue) {
                            ?>
                            <div class="flatui"><label><?php echo $i . '.  ' . $makeQueryvalue->name; ?></label><input type="checkbox" class="selected_checkbox_<?php echo $data->id; ?>" id="send_user_details_class_<?php echo $data->id; ?>_checkbox_<?php echo $makeQueryvalue->users_id; ?>" value="<?php echo $makeQueryvalue->users_id; ?>"></div>  
                            <?php
                            $i++;
                        }
                        ?>


                    </div>
                    <?php
                } else {
                    echo '<div class="attendeesList" style="margin: 59px 0px 0px 0px;font-size: 21px;"> No query For this class. </div>';
                }
                ?>
            </div>                         
            <div class="clear"></div>                	                      
        </div>
        <div id='formResult_<?php echo $data->id; ?>' style='margin:20px;'></div>
        <div id="send_a_msg_box_<?php echo $data->id; ?>" style="margin: 9px 120px 0px 18px;display:none;" class="sendMessageTouser">
            <div id="AjaxLoader_<?php echo $data->id; ?>" style="display:none;" align="center">&nbsp;<img src="<?php echo ThemePath(); ?>/images/fancybox_loading@2x.gif" align="absmiddle"></div>
            <div class="common  formElements"> 
                <label for="Send_a_msg_subject" >Subject <span class="required">*</span></label>
                <div class="clear"></div>
                <input class="field oneCol " title="subject" name="subject" id="subject_<?php echo $data->id; ?>" type="text" maxlength="45">
                <div  class="errorMessage" id='errorMessage_subject_<?php echo $data->id; ?>'></div>
                <div class="clear"></div>
            </div>
            <div class="common formElements">
                <label for="send_a_msg_box_<?php echo $data->id; ?>">Write Message: <span class="required">*</span></label>
                <div class="clear"></div>
                <textarea  class=" requiredfield" id="message_text_<?php echo $data->id; ?>" name="message_text"></textarea>
                <div  class="errorMessage" id='errorMessage_msg_<?php echo $data->id; ?>'></div>
                <div class="clear"></div>
            </div>

        </div>
        <div class="padding20px alignR">
            <div id="error_text_not_checked_<?php echo $data->id; ?>" class="errorMessage"></div>
            <p style="float:left;padding: 10px 19px!important;" class="btn-orange active_status_class_details<?php echo $data->id; ?>"> Course Status  : <?php echo ($data->status != 1) ? 'Inactive' : 'Active'; ?></p><a href="<?php echo $this->createAbsoluteUrl('/courses-'.$data->id.'/'.$data->course_seo_title) ?>" class="btn-blue view_class_details<?php echo $data->id; ?>">View Course Details</a>
            <input type="button" class="btn-blue  edit_class_details<?php echo $data->id; ?>" value="Edit Course Details" id="<?php echo $data->auth_key; ?>" onclick="setAuthKey(this.id, 'courses/update')">
            <?php if (!empty($makeQuery)) { ?>
                <input type="button" class="btn showClassuserBtn" value="Cancel" id="review_cancel_btn_<?php echo $data->id; ?>" onclick="cancelQuery(<?php echo $data->id; ?>)" style="display: none;">
                <input type="button" class="btn" value="Message" id="send_message_<?php echo $data->id; ?>" onclick="sendMessageToConevertedUser(<?php echo $data->id; ?>)">
                <input type="button" class="btn sendMessageTouser"style="display:none" value="Send Mail" id="send_message_to_users_<?php echo $data->id; ?>" onclick="sendAMailToAllConvertedUser(<?php echo $data->id; ?>)">
            <?php } ?></div>
    </fieldset>

</div>

